﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.TeamFoundation.VersionControl.Client;

namespace PsTFS.Objects
{
    /// <summary>
    /// Objet permettant de gérer les informations des merge (Fusion)
    /// </summary>
    public struct MergeInfo
    {
        /// <summary>
        /// Source de la fusion
        /// </summary>
        public string SourceServerPath { get; set; }

        /// <summary>
        /// Numéro de l'ID source
        /// </summary>
        public int SourceChangesetId { get; set; }

        /// <summary>
        /// Destination de la fusion
        /// </summary>
        public string TargetServerPath { get; set; }
        /// <summary>
        /// Numéro ID de destination
        /// </summary>
        public int TargetChangesetId { get; set; }


        /// <summary>
        /// Surcharge du ToString pour afficher les informations
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return string.Format("{0}{4}C{1} -> {2}{4}C{3}",
                SourceServerPath,
                SourceChangesetId,
                TargetServerPath,
                TargetChangesetId,
                VersionSpec.Separator);
        }
    }
}

